home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / u_man / cat1 / test.z / test
Text File  |  1998-10-20  |  5KB  |  133 lines

  1.  
  2.  
  3.  
  4. TTTTEEEESSSSTTTT((((1111))))                                                                TTTTEEEESSSSTTTT((((1111))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      test - condition evaluation command
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      tttteeeesssstttt expr
  13.      [[[[ expr ]]]]
  14.  
  15. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  16.      _t_e_s_t evaluates the expression _e_x_p_r and, if its value is true, sets a zero
  17.      (true) exit status; otherwise, a non-zero (false) exit status is set;
  18.      _t_e_s_t also sets a non-zero exit status if there are no arguments.  When
  19.      permissions are tested, the effective user ID of the process is used.
  20.  
  21.      All operators, flags, and brackets (brackets used as shown in the second
  22.      SYNOPSIS line) must be separate arguments to the _t_e_s_t command; normally
  23.      these items are separated by spaces.
  24.  
  25.      The following primitives are used to construct _e_x_p_r:
  26.  
  27.      ----rrrr _f_i_l_e     true if _f_i_l_e exists and is readable.
  28.  
  29.      ----llll _f_i_l_e     true if _f_i_l_e exists and is a symbolic link.
  30.  
  31.      ----wwww _f_i_l_e     true if _f_i_l_e exists and is writable.
  32.  
  33.      ----xxxx _f_i_l_e     true if _f_i_l_e exists and is executable.
  34.  
  35.      ----ffff _f_i_l_e     true if _f_i_l_e exists and is a regular file.
  36.  
  37.      ----dddd _f_i_l_e     true if _f_i_l_e exists and is a directory.
  38.  
  39.      ----hhhh _f_i_l_e     true if _f_i_l_e exists and is a symbolic link.
  40.  
  41.      ----cccc _f_i_l_e     true if _f_i_l_e exists and is a character special file.
  42.  
  43.      ----bbbb _f_i_l_e     true if _f_i_l_e exists and is a block special file.
  44.  
  45.      ----pppp _f_i_l_e     true if _f_i_l_e exists and is a named pipe (fifo).
  46.  
  47.      ----uuuu _f_i_l_e     true if _f_i_l_e exists and its set-user-ID bit is set.
  48.  
  49.      ----gggg _f_i_l_e     true if _f_i_l_e exists and its set-group-ID bit is set.
  50.  
  51.      ----kkkk _f_i_l_e     true if _f_i_l_e exists and its sticky bit is set.
  52.  
  53.      ----ssss _f_i_l_e     true if _f_i_l_e exists and has a size greater than zero.
  54.  
  55.      ----tttt [ _f_i_l_d_e_s ]
  56.                  true if the open file whose file descriptor number is _f_i_l_d_e_s
  57.                  (1 by default) is associated with a terminal device.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. TTTTEEEESSSSTTTT((((1111))))                                                                TTTTEEEESSSSTTTT((((1111))))
  71.  
  72.  
  73.  
  74.      ----zzzz _s_1       true if the length of string _s_1 is zero.
  75.  
  76.      ----nnnn _s_1       true if the length of the string _s_1 is non-zero.
  77.  
  78.      _s_1 ==== _s_2     true if strings _s_1 and _s_2 are identical.
  79.  
  80.      _s_1 !!!!==== _s_2    true if strings _s_1 and _s_2 are _n_o_t identical.
  81.  
  82.      _s_1          true if _s_1 is _n_o_t the null string.
  83.  
  84.      _n_1 ----eeeeqqqq _n_2   true if the integers _n_1 and _n_2 are algebraically equal.  Any
  85.                  of the comparisons ----nnnneeee, ----ggggtttt, ----ggggeeee, ----lllltttt, and ----lllleeee may be used in
  86.                  place of ----eeeeqqqq.
  87.  
  88.      ----LLLL _f_i_l_e     true if _f_i_l_e exists and is a symbolic link.
  89.  
  90.      These primaries may be combined with the following operators:
  91.  
  92.      !!!!           unary negation operator.
  93.  
  94.      ----aaaa          binary _a_n_d operator.
  95.  
  96.      ----oooo          binary _o_r operator (----aaaa has higher precedence than ----oooo).
  97.  
  98.      (((( expr ))))    parentheses for grouping.  Notice also that parentheses are
  99.                  meaningful to the shell and, therefore, must be quoted.
  100.  
  101. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  102.      find(1), sh(1).
  103.  
  104. WWWWAAAARRRRNNNNIIIINNNNGGGG
  105.      If you test a file you own (the -_r, -_w, or -_x tests), but the permission
  106.      tested does not have the _o_w_n_e_r bit set, a non-zero (false) exit status
  107.      will be returned even though the file may have the _g_r_o_u_p or _o_t_h_e_r bit set
  108.      for that permission.  The correct exit status will be set if you are
  109.      super-user.
  110.  
  111.      The ==== and !!!!==== operators have a higher precedence than the ----rrrr through ----nnnn
  112.      operators, and ==== and !!!!==== always expect arguments; therefore, ==== and !!!!====
  113.      cannot be used with the ----rrrr through ----nnnn operators.
  114.  
  115.      If more than one argument follows the ----rrrr through ----nnnn operators, only the
  116.      first argument is examined; the others are ignored, unless a ----aaaa or a ----oooo
  117.      is the second argument.
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.